﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pro_ArticleChange.aspx.cs" ValidateRequest="false" Inherits="ArtLand.OA.Project.Project.Pro_ArticleChange" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../js/jquery-1.4.1.min.js"></script>
    <script src="../js/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="../ueditor/themes/default/ueditor.css" />
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
        <ext:Panel ID="Panel1" BodyPadding="10px" runat="server" EnableBackgroundColor="false"
            EnableCollapse="True" Title="面板" Width="600px" ShowHeader="false" ShowBorder="false" AutoScroll="true">
            <Toolbars>
                <ext:Toolbar Position="Footer">
                    <Items>
                        <ext:Button Text="保存" Icon="DatabaseSave" ValidateForms="SimpleForm2" ID="btnSave" runat="server" OnClick="btnSave_Click"></ext:Button>
                        <ext:Button Text="关闭" Icon="SystemClose" ID="btnClose" runat="server"></ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <Items>
                <ext:SimpleForm ID="SimpleForm2" EnableBackgroundColor="false" ShowBorder="false" ShowHeader="false" Width="630px" BodyPadding="5px" Title="表单" runat="server">
                    <Items>
                        <ext:Panel ID="Panel2" ShowHeader="false" CssClass="x-form-item" ShowBorder="false"
                            Layout="Column" runat="server">
                            <Items>
                                <ext:Label runat="server" Text="标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题："></ext:Label>
                                <ext:TextBox runat="server" ID="txt_Title" Required="true" ShowRedStar="true" Label="文章标题"
                                    Width="328px">
                                </ext:TextBox>
                                <ext:Label ID="Label1" runat="server" Text="&nbsp;"></ext:Label>
                                <ext:Button Icon="ColorSwatch" runat="server" ID="BtnColor" EnablePostBack="false"
                                    ToolTip="选择颜色" Text="选择颜色">
                                </ext:Button>
                                <ext:Label ID="Label6" runat="server" Text="&nbsp;"></ext:Label>
                                <ext:Button runat="server" ID="btn_Bold" OnClientClick="SetBold();" EnablePress="true" Text="" Icon="TextBold"></ext:Button>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="Panel3" ShowHeader="false" CssClass="x-form-item" ShowBorder="false"
                            Layout="Column" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="开始时间："></ext:Label>
                                <ext:TextBox runat="server" Required="true" Label="开始时间" ID="txt_STDATE" Width="160px"></ext:TextBox>
                                <ext:Label ID="Label4" runat="server" Text="&nbsp;&nbsp;&nbsp;&nbsp;"></ext:Label>
                                <ext:Label ID="Label3" runat="server" Text="结束时间："></ext:Label>
                                <ext:TextBox runat="server" Required="true" Label="结束时间" ID="txt_EDDATE" Width="160px"></ext:TextBox>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="Panel4" ShowHeader="false" CssClass="x-form-item" ShowBorder="false"
                            Layout="Column" runat="server">
                            <Items>
                                <ext:Label ID="Label5" runat="server" Text="属&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;性："></ext:Label>
                                <ext:DropDownList runat="server" ID="Drp_NATURE" Label="属性"></ext:DropDownList>
                            </Items>
                        </ext:Panel>
                        <ext:ContentPanel AutoScroll="true" ID="ContentPanel1" runat="server" CssClass="x-form-item" EnableBackgroundColor="false"
                            ShowBorder="false" ShowHeader="false">
                            <table cellpadding="0" cellspacing="0" style="width: 100%;">
                                <tr>
                                    <td valign="top" style="width: 60px;">文章正文：
                                    </td>
                                    <td>
                                        <textarea name="UEditor1" id="UEditor1"><%=ContentS %>
                            </textarea>
                                    </td>
                                </tr>
                            </table>
                        </ext:ContentPanel>
                    </Items>
                </ext:SimpleForm>

                <%--<ext:GroupPanel ID="GroupPanel2" EnableBackgroundColor="true" AutoHeight="true" Title="查看权限"
                    runat="server">
                    <Items>
                    </Items>
                </ext:GroupPanel>--%>
            </Items>
        </ext:Panel>
        <ext:HiddenField runat="server" ID="txt_Color">
        </ext:HiddenField>
        <ext:Window ID="Window1" runat="server" Height="204px" Hidden="true" EnableIFrame="true"
            IsModal="false" Top="38px" Left="399px" Width="250px" Title="选择字体颜色">
            <Toolbars>
                <ext:Toolbar>
                    <Items>
                        <ext:Button Text="取消" OnClientClick="ClearColor();">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <Items>
                <ext:ContentPanel ShowBorder="false" ShowHeader="false" EnableBackgroundColor="true">
                    <%=GetColor()%>
                </ext:ContentPanel>
            </Items>
        </ext:Window>
        <ext:HiddenField runat="server" ID="hid_Color"></ext:HiddenField>
        <ext:HiddenField runat="server" ID="hid_Bold" Text="0"></ext:HiddenField>
    </form>

    <script type="text/javascript">
        window.UEDITOR_HOME_URL = '<%= ResolveUrl("~/ueditor/") %>';
    </script>
    <script src="../js/ShowD.js"></script>
    <script type="text/javascript" src="../ueditor/editor_config_minii.js"></script>
    <script type="text/javascript" src="../ueditor/editor_all_min.js"></script>
    <script type="text/javascript">
        var editor1;
        // 提交数据之前同步到表单隐藏字段
        X.util.beforeAjaxPostBackScript = function () {
            editor1.sync();
        };


        // 更新编辑器内容
        function updateUEditor1(content) {
            window.setTimeout(function () {
                editor1.setContent(content);
            }, 100);
        }

        function SetBold() {
            var xtitle = "<%=txt_Title.ClientID %>";
            if ($("#" + xtitle).css("font-weight") == "bold") {
                $("#" + xtitle).css("font-weight", "");
                $("#<%=hid_Bold.ClientID %>").val("0");
            }
            else {
                $("#" + xtitle).css("font-weight", "bold");
                $("#<%=hid_Bold.ClientID %>").val("1");
            }
        }

        function Selcolor(c) {
            X('Window1').box_hide();
            $("#<%=BtnColor.ClientID %>").find("button").html("#" + c);
            $("#<%=BtnColor.ClientID %>").find("button").css("width", "80px");
            $("#<%=txt_Title.ClientID %>").css("color", "#" + c);
            $("#<%=txt_Color.ClientID %>").val("#" + c);
        }
        function ClearColor() {
            X('Window1').box_hide();
            $("#<%=BtnColor.ClientID %>").find("button").html("选择颜色");
            $("#<%=BtnColor.ClientID %>").find("button").css("width", "67px");
            $("#<%=txt_Title.ClientID %>").css("color", "");
            $("#<%=txt_Color.ClientID %>").val("");
        }
        var STDATE = "<%=txt_STDATE.ClientID%>";
        var EDDATE = "<%=txt_EDDATE.ClientID%>";
        function onReady() {
            editor1 = new UE.ui.Editor({
                initialFrameWidth: '100%',
                autoFloatEnabled: true
            });
            editor1.render("UEditor1");
            var color = $("#<%=txt_Color.ClientID %>").val();
            $("#<%=txt_Title.ClientID %>").css("color", color);

            var bold = $("#<%=hid_Bold.ClientID %>").val();


            var xtitle = "<%=txt_Title.ClientID %>";
            if (bold == "0") {
                $("#" + xtitle).css("font-weight", "");
            }
            else
                $("#" + xtitle).css("font-weight", "bold");
            ShowD(STDATE);
            ShowD(EDDATE);
        }
    </script>
</body>
</html>
